Carbon


GetWindowBounds

Header: MacWindows.h Carbon status: Supported

Obtains the size and position of the bounding rectangle of the specified window region.

OSStatus GetWindowBounds (
    WindowRef window, 
    WindowRegionCode regionCode, 
    Rect *globalBounds
);
window

A pointer to the window whose bounds you wish to obtain.

regionCode

A constant identifying the window region whose bounds you wish to obtain. Currently, the only valid values for the region code are kWindowStructureRgn and kWindowContentRgn.

globalBounds

A pointer to a structure of type Rect. On return, the rectangle contains the dimensions and position, in global coordinates, of the window region specified in the regionCode parameter.

function result

A result code.

DISCUSSION

When you call the function SetWindowBounds, your application specifies whether the window’s content region or its structure region is more important in determining the window’s ultimate size and position. This distinction can be important with versions of the Mac OS running the Appearance Manager, since the total dimensions of a window—and, therefore, its spatial relationship to the rest of the screen—may vary from appearance to appearance. Use the GetWindowBounds function to obtain the bounding rectangle for either of these regions for the specified window.

VERSION NOTES

This function is available with Mac OS 8.5 and later.

AVAILABILITY

Supported in Carbon. Available in CarbonLib 1.0 and later when WindowsLib 8.5 or later is installed. Exported by CarbonLib 1.0 and later and by WindowsLib 8.5 and later.


© 2000 Apple Computer, Inc. — (Last Updated 4/14/2000)